package cn.sunxyz;

/**
 * Created by yangrd on 2017/5/12.
 */
public class RefUtil {

    public static <T> T newInstance(String classPath) {
        try {
            Class<?> c = Class.forName(classPath);
            return (T) c.newInstance();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }
}
